﻿
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using Model;


namespace MsDAL
{
    public partial class Bas1a10DAL : Bas1a10Base
    {
        /// <summary>
        /// 将状态设置为删除
        /// </summary>
        /// <returns></returns>
        public SqlApp DeleteModel(string listid)
        {
            string sql = " update Bas1a10 set status = '4' WHERE listid =@listid AND status ='1' ";

            SqlParameter[] parameters = {
				new SqlParameter("@listid",SqlDbType.NVarChar)
				};
            parameters[0].Value = listid;

            return new SqlApp(sql, new ArrayList(parameters), false, "该销售商可能已经被删除，请重新操作！");
        }

        public SqlApp UpdateBalance(string sellerid, decimal amout)
        {
            string sql = " update Bas1a10 set balance = balance + @balance WHERE listid =@listid ";

            SqlParameter[] parameters = {
				new SqlParameter("@listid",SqlDbType.NVarChar),
				new SqlParameter("@balance",SqlDbType.Decimal)
				};
            parameters[0].Value = sellerid;
            parameters[1].Value = amout;

            return new SqlApp(sql, new ArrayList(parameters), false, "更新供应商余额失败！");
        }
    }
}
